<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="layouts::header"></head>
<nav th:replace="layouts::navbar"></nav>

<div class="container-fluid">
    <form th:action="@{/pDetails/save}" th:object="${pDetails}" method="POST">

        <input type="hidden" th:field="${pDetails.pdId}">
        <div class="logo"></div>
        <hr>

        进货ID:<input type="text"  th:field="*{purchases}" list="purchaseId">
        <datalist id="purchaseId">
            <option th:each="purchase : ${allPurchases}" th:value="${purchase.purchaseId}" th:text="${purchase.purchaseId}"></option>
        </datalist>

        商品名称：<select th:field="*{commodities}">
                    <option th:each="commodity : ${allCommodities}" th:value="${commodity.commodityId}" th:text="${commodity.name}"></option>
                </select>
<!--        <label for="purchaseId">进货编号:</label>-->
<!--        <input type="text" id="purchaseId" th:field="${pDetails.purchaseId}">-->
<!--        <label for="name">商品ID：</label>-->
<!--        <input type="text" id="name" th:field="${pDetails.commodityId}">-->
<!--        <label for="name"></label>-->
<!--        <input type="text" id="name" th:field="${pDetails.name}">-->
        <label for="number">进货数量：</label>
        <input type="text" id="number" th:field="${pDetails.quantity}">
        <label for="amount">进货总金额:</label>
        <input type="text" id="amount" th:field="${pDetails.amount}">
        <label for="price">进货单价:</label>
        <input type="text" id="price" th:field="${pDetails.price}">
        <button type="submit">新增进货明细</button>
    </form>
</div>
</body>
</html>